<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>第一个EasyUI测试</title>
		<link href="<%=request.getContextPath()%>/jquery-easyui-1.5/themes/bootstrap/easyui.css" rel="stylesheet"/>
		<link href="<%=request.getContextPath()%>/jquery-easyui-1.5/themes/icon.css" rel="stylesheet"/>
		<script src="<%=request.getContextPath()%>/jquery-easyui-1.5/jquery.min.js"></script>
		<script src="<%=request.getContextPath()%>/jquery-easyui-1.5/jquery.easyui.min.js"></script>
		<script src="<%=request.getContextPath()%>/jquery-easyui-1.5/locale/easyui-lang-zh_CN.js"></script>
	</head>
	<body>
	
		<div id="dd" style="padding:5px;width:400px;height:200px;" class="easyui-dialog" data-options="
		title: '一个弹窗',
		iconCls: 'icon-ok',
		toolbar: '#dlg-toolbar',
		buttons: '#dlg-buttons',
		modal: false,
		closable: true,
		maximizable:false,
		closed: true">
			这是弹窗中的内容
		</div>
		
		<!-- 工具条 -->
		<div id="dlg-toolbar">
			<a href="#" onclick="javascript:alert('Add')" class="easyui-linkbutton" data-options="
			iconCls: 'icon-add',
			plain: true">
				Add
			</a>
			<a href="#" onclick="javascript:alert('Save')" class="easyui-linkbutton" data-options="
			iconCls: 'icon-save',
			plain: true">
				Save
			</a>
		</div>
		<!-- 按钮 -->
		<div id="dlg-buttons">
			<a href="#" onclick="javascript:alert('Ok')" class="easyui-linkbutton" data-options="
			iconCls: 'icon-ok'">
				Ok
			</a>
			<a href="#" id="but" onclick="javascript:$('#dd').dialog('close')" onfocus="onfocus()" class="easyui-linkbutton" data-options="
			iconCls: 'icon-cancel'">
				Cancel
			</a>
		</div>
		
		<button type="button" onclick="$('#dd').dialog('open')">显示Dialog</button>
		<button type="button" onclick="$('#dd').dialog('close')">隐藏Dialog</button>
		
	</body>
	
	<script >
	
	function onfocus(){
		$('#dd').dialog({
			title: '一个弹窗',
			width: '#sum(1,1000)',
			height: '#sum(1,1000)',
			closed: false,
			cache: false,
			collapsible: true,
			maximizable: true,
			resizable: true,
			shadow: true,
			left: 150,
			top:50,
			
			modal: true,
			content: ''
			});
	}
	
	function sum (m,n){
		var num = Math.floor(Math.random()*(m - n) + n);
		alert(num)
		}
		sum(1,1000);
	</script>
	
	
</html>